From 4f0dc8892468f6434f95d9bfaf6f42fad92e541c Mon Sep 17 00:00:00 2001 From: James Bendig Date: Wed, 8 Feb 2017 15:30:24 -0600 Subject: [PATCH] Added documentation for the target field `required-features`. --- src/doc/manifest.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/doc/manifest.md b/src/doc/manifest.md index 8ee88efe2..d6e1aa12a 100644 --- a/src/doc/manifest.md +++ b/src/doc/manifest.md @@ -551,6 +551,24 @@ proc-macro = false harness = true ``` +## The `required-features` field (optional) + +The `required-features` field specifies which features must be selected for the +target to be built. This is only relevant for the `[[bin]]`, `[[bench]]`, +`[[test]]`, and `[[example]]` sections, it has no effect on `[lib]`. + +```toml +[features] +# ... +postgres = [] +sqlite = [] +tools = [] + +[[bin]] +# ... +required-features = ["postgres", "tools"] +``` + # Building dynamic or static libraries If your project produces a library, you can specify which kind of library to -- 2.30.2